package com.hanqi.entity;

import com.hanqi.util.shiro.ShiroUtil;
import org.apache.shiro.crypto.hash.Md5Hash;
import org.apache.shiro.util.ByteSource;

import java.time.LocalDateTime;
import java.io.Serializable;

/**
 * <p>
 *
 * </p>
 *
 * @author zjk
 * @since 2019-04-27
 */
public class SysUser implements Serializable {

    private static final long serialVersionUID = 1L;

    private String id;

    private String uname;

    private String pword;

    private String rname;

    private String salt;

    private Integer userType;

    private String createName;

    private LocalDateTime createDate;

    private Integer deleteFlag;

    public ByteSource getSaltSouce() {
        return ShiroUtil.string2ByteSource(this.salt);
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getUname() {
        return uname;
    }

    public void setUname(String uname) {
        this.uname = uname;
    }

    public String getPword() {
        return pword;
    }

    public void setPword(String pword) {
        this.pword = pword;
    }

    public String getRname() {
        return rname;
    }

    public void setRname(String rname) {
        this.rname = rname;
    }

    public Integer getUserType() {
        return userType;
    }

    public void setUserType(Integer userType) {
        this.userType = userType;
    }

    public String getCreateName() {
        return createName;
    }

    public void setCreateName(String createName) {
        this.createName = createName;
    }

    public LocalDateTime getCreateDate() {
        return createDate;
    }

    public void setCreateDate(LocalDateTime createDate) {
        this.createDate = createDate;
    }

    public Integer getDeleteFlag() {
        return deleteFlag;
    }

    public void setDeleteFlag(Integer deleteFlag) {
        this.deleteFlag = deleteFlag;
    }

    @Override
    public String toString() {
        return "SysUser{" +
                "id=" + id +
                ", uname=" + uname +
                ", pword=" + pword +
                ", rname=" + rname +
                ", salt=" + salt +
                ", userType=" + userType +
                ", createName=" + createName +
                ", createDate=" + createDate +
                ", deleteFlag=" + deleteFlag +
                "}";
    }

    public String getSalt() {
        return salt;
    }

    public void setSalt(String salt) {
        this.salt = salt;
    }
}
